load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

go_library(
    name = "obsservice_lib",
    srcs = ["main.go"],
    importpath = "github.com/cockroachdb/cockroach/pkg/obsservice/cmd/obsservice",
    visibility = ["//visibility:private"],
    deps = [
        "//pkg/cli/exit",
        "//pkg/obsservice/obslib",
        "//pkg/obsservice/obslib/ingest",
        "//pkg/obsservice/obslib/migrations",
        "//pkg/obsservice/obslib/obsutil",
        "//pkg/obsservice/obslib/router",
        "//pkg/obsservice/obspb",
        "//pkg/obsservice/obspb/opentelemetry-proto/collector/logs/v1:logs_service",
        "//pkg/util/log",
        "//pkg/util/stop",
        "//pkg/util/sysutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_jackc_pgx_v5//pgxpool",
        "@com_github_spf13_cobra//:cobra",
        "@org_golang_google_grpc//:go_default_library",
        "@org_golang_x_sys//unix",
    ],
)

go_binary(
    name = "obsservice",
    embed = [":obsservice_lib"],
    visibility = ["//visibility:public"],
)
